<?php
if ( ! defined( 'IN_IPB' ) )
{
	print "<h1>Incorrect access</h1>You cannot access this file directly. If you have recently upgraded, make sure you upgraded 'admin.php'.";
	exit();
}

class sql_plugin_queries extends db_driver_mysql
{

     var $db  = "";
     var $tbl = "";
     
    /*========================================================================*/
    // Set up...             
    /*========================================================================*/  
                   
    function sql_plugin_queries( &$obj )
    {
    	$this->db = &$obj;
    	
    	if ( ! isset($this->db->obj['sql_tbl_prefix']) )
    	{
    		$this->db->obj['sql_tbl_prefix'] = SQL_PREFIX;
    	}
    	
    	$this->tbl = $this->db->obj['sql_tbl_prefix'];
    }

	function table_bank_starter()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_bank_starter (
				 starter_id mediumint(8) NOT NULL auto_increment,
				 s_name varchar(255) NOT NULL default '',
				 s_description text NOT NULL,
				 s_interest_time int(10) NOT NULL default '0',
				 s_interest_rate float(15,10) NOT NULL default '0.0000000000',
				 s_deposit_fee float(15,10) NOT NULL default '0.0000000000',
				 s_withdraw_fee float(15,10) NOT NULL default '0.0000000000',
				 create_price bigint(19) NOT NULL default '0',
				 delete_fee bigint(19) NOT NULL default '0',
				 PRIMARY KEY (starter_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_bank_account()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_bank_accounts (
				 account_id int(10) NOT NULL auto_increment,
				 a_random mediumint(6) NOT NULL default '0',
				 a_mem_id mediumint(8) NOT NULL default '0',
				 a_name varchar(255) NOT NULL default '',
				 a_open int(10) NOT NULL default '0',
				 balance bigint(19) NOT NULL default '0',
				 a_interest_time int(10) NOT NULL default '0',
				 a_last_interest int(10) NOT NULL default '0',
				 interest_rate float(15,10) NOT NULL default '0.0000000000',
				 a_deposit_fee float(15,10) NOT NULL default '0.0000000000',
				 a_withdraw_fee float(15,10) NOT NULL default '0.0000000000',
				 a_delete_fee bigint(19) NOT NULL default '0',
				 PRIMARY KEY (account_id),
				 KEY account_id (a_mem_id,a_random,account_id),
				 KEY member_id (a_mem_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_bank_transactions()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_bank_transactions (
				 l_id int(10) NOT NULL auto_increment,
				 l_account_id varchar(255) NOT NULL default '',
				 l_timestamp int(10) NOT NULL default '0',
				 l_ip_address varchar(15) NOT NULL default '',
				 l_action varchar(255) NOT NULL default '',
				 l_amount bigint(15) NOT NULL default '0',
				 l_balance bigint(15) NOT NULL default '0',
				 l_fee bigint(15) NOT NULL default '0',
				 PRIMARY KEY (l_id),
				 KEY account_id (l_account_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_transfer_logs()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_transfer_logs (
				 l_id int(10) NOT NULL auto_increment,
				 l_link varchar(15) NOT NULL default '',
				 l_time int(10) NOT NULL default '0',
				 l_ip_address varchar(15) NOT NULL default '',
				 l_from mediumint(8) NOT NULL default '0',
				 l_to mediumint(8) NOT NULL default '0',
				 l_amount bigint(19) NOT NULL default '0',
				 l_fee bigint(19) NOT NULL default '0',
				 l_anon tinyint(1) NOT NULL default '0',
				 PRIMARY KEY (l_id),
				 KEY from_id (l_from,l_link),
				 KEY to_id (l_to,l_link)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_transfer_item_logs()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_transfer_item_logs (
				 log_id int(10) NOT NULL default '0',
				 l_inventory_id int(10) NOT NULL default '0',
				 l_item_id int(10) NOT NULL default '0',
				 l_price_bought int(10) NOT NULL default '0',
				 l_resell_price int(10) NOT NULL default '0',
				 l_item_category int(10) NOT NULL default '0',
				 l_item_name varchar(255) NOT NULL default '',
				 l_item_description text NOT NULL,
				 l_item_icon varchar(255) NOT NULL default '',
				 l_category_name varchar(255) NOT NULL default '',
				 KEY log_id (log_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_converter_logs()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_converter_logs (
				 log_id int(10) NOT NULL auto_increment,
				 l_link varchar(255) NOT NULL default '',
				 l_member_id mediumint(8) NOT NULL default '0',
				 l_ip_address varchar(15) NOT NULL default '',
				 l_time int(10) NOT NULL default '0',
				 l_direction enum('from','to') NOT NULL default 'from',
				 l_amount bigint(19) NOT NULL default '0',
				 l_fee bigint(19) NOT NULL default '0',
				 PRIMARY KEY (log_id),
				 KEY log_info (l_link,l_member_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_scratchcard_card()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_scratchcard_card (
				 sc_id mediumint(8) NOT NULL auto_increment,
				 folder varchar(255) NOT NULL default '',
				 size_width smallint(5) NOT NULL default '0',
				 size_height smallint(5) NOT NULL default '0',
				 card_img varchar(255) NOT NULL default '',
				 empty_img varchar(255) NOT NULL default '',
				 choice_imgs text NOT NULL,
				 choice_info text NOT NULL,
				 no_columns tinyint(3) NOT NULL default '0',
				 no_rows tinyint(3) NOT NULL default '0',
				 game_type varchar(255) NOT NULL default '',
				 name varchar(255) NOT NULL default '',
				 description text NOT NULL,
				 price bigint(19) NOT NULL default '0',
				 prizes text NOT NULL,
				 PRIMARY KEY (sc_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_scratchcard_ticket()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_scratchcard_ticket (
				 tick_id int(10) NOT NULL auto_increment,
				 card_id mediumint(8) NOT NULL default '0',
				 time_created int(10) NOT NULL default '0',
				 member_id mediumint(8) NOT NULL default '0',
				 choices text NOT NULL,
				 seen text NOT NULL,
				 used tinyint(1) NOT NULL default '0',
				 won tinyint(3) NOT NULL default '0',
				 money bigint(19) NOT NULL default '0',
				 ip_address varchar(15) NOT NULL default '',
				 PRIMARY KEY (tick_id),
				 KEY member_id (member_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_auction_item()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_auction_item (
				 a_id int(10) NOT NULL auto_increment,
				 member_id mediumint(8) NOT NULL default '0',
				 item int(10) NOT NULL default '0',
				 price_bought bigint(19) NOT NULL default '0',
				 resell_price bigint(19) NOT NULL default '0',
				 time_bought int(10) NOT NULL default '0',
				 settings TEXT NOT NULL,
				 expired int(10) NOT NULL default '0',
				 ip_address varchar(15) NOT NULL default '',
				 time_start int(10) NOT NULL default '0',
				 duration int(10) NOT NULL default '0',
				 time_end int(10) NOT NULL default '0',
				 paid tinyint(1) NOT NULL default '0',
				 removed tinyint(1) NOT NULL default '0',
				 start_bid bigint(19) NOT NULL default '0',
				 user_description text NOT NULL,
				 highest_bid bigint(19) NOT NULL default '0',
				 highest_id mediumint(8) NOT NULL default '0',
				 PRIMARY KEY (a_id),
				 KEY member_id (member_id),
				 KEY the_item (item)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_auction_bids()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_auction_bids (
				 b_id int(10) NOT NULL auto_increment,
				 aitem_id int(10) NOT NULL default '0',
				 member_id mediumint(8) NOT NULL default '0',
				 highest_bid bigint(19) NOT NULL default '0',
				 bid_time int(10) NOT NULL default '0',
				 ip_address varchar(15) NOT NULL default '',
				 PRIMARY KEY (b_id),
				 KEY item_id (aitem_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_quizzes()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_quizzes (
				 quiz_id int(10) NOT NULL auto_increment,
				 q_name varchar(255) NOT NULL default '',
				 q_description text NOT NULL,
				 q_tries tinyint(3) NOT NULL default '0',
				 q_percent_win float(15,10) NOT NULL default '0.0000000000',
				 q_ending_time int(10) NOT NULL default '0',
				 q_timeout int(10) NOT NULL default '0',
				 q_prize_money bigint(19) NOT NULL default '0',
				 q_prize_items text NOT NULL,
				 PRIMARY KEY (quiz_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_quiz_question()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_quiz_question (
				 question_id int(10) NOT NULL auto_increment,
				 quiz_id int(10) NOT NULL default '0',
				 q_type varchar(255) NOT NULL default '',
				 question text NOT NULL,
				 choices text NOT NULL,
				 answer text NOT NULL,
				 case_sensitive tinyint(1) NOT NULL default '0',
				 space_sensitive tinyint(1) NOT NULL default '0',
				 weight float(15,10) NOT NULL default '0.0000000000',
				 penalty float(15,10) NOT NULL default '0.0000000000',
				 blank_penalty tinyint(1) NOT NULL default '0',
				 match_choice smallint(5) NOT NULL default '0',
				 PRIMARY KEY (question_id),
				 KEY quiz_id (quiz_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_quiz_taken()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_quiz_taken (
				 quiz_id int(10) NOT NULL default '0',
				 member_id mediumint(8) NOT NULL default '0',
				 ip_address varchar(15) NOT NULL default '0',
				 time_start int(10) NOT NULL default '0',
				 time_taken int(10) NOT NULL default '0',
				 percent_correct float(15,10) NOT NULL default '0',
				 passed_quiz tinyint(1) NOT NULL default '0',
				 KEY taken_id (quiz_id,member_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_quiz_sessions()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_quiz_sessions (
				 session_id varchar(32) NOT NULL,
				 quiz_id int(10) NOT NULL default '0',
				 member_id mediumint(8) NOT NULL default '0',
				 time_started int(10) NOT NULL default '0',
				 PRIMARY KEY (session_id),
				 KEY seesion (quiz_id,member_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_user_store_item()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_user_store_item (
				 i_id int(10) NOT NULL auto_increment,
				 member_id mediumint(8) NOT NULL default '0',
				 item int(10) NOT NULL default '0',
				 price_bought bigint(19) NOT NULL default '0',
				 resell_price bigint(19) NOT NULL default '0',
				 time_bought int(10) NOT NULL default '0',
				 settings TEXT NOT NULL,
				 expired int(10) NOT NULL default '0',
				 ip_address varchar(15) NOT NULL default '',
				 listed int(10) NOT NULL default '0',
				 store_price bigint(19) NOT NULL default '0',
				 PRIMARY KEY (i_id),
				 KEY member_id (member_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_user_store_logs()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_user_store_logs (
				 l_id int(10) NOT NULL auto_increment,
				 seller_id mediumint(8) NOT NULL default '0',
				 buyer_id mediumint(8) NOT NULL default '0',
				 buyer_ip varchar(15) NOT NULL default '',
				 item int(10) NOT NULL default '0',
				 time_bought int(10) NOT NULL default '0',
				 price bigint(19) NOT NULL default '0',
				 settings TEXT NOT NULL,
				 PRIMARY KEY (l_id),
				 KEY seller (seller_id),
				 KEY buyer (buyer_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_lottery()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_lottery (
				 l_id int(10) NOT NULL auto_increment,
				 l_name varchar(255) NOT NULL default '',
				 l_description text NOT NULL,
				 l_status enum('open','closed','drawn') NOT NULL default 'open',
				 l_type varchar(255) NOT NULL default '',
				 l_settings text NOT NULL default '',
				 create_time int(10) NOT NULL default '0',
				 start_time int(10) NOT NULL default '0',
				 end_time int(10) NOT NULL default '0',
				 continuous tinyint(1) NOT NULL default '0',
				 l_price bigint(19) NOT NULL default '0',
				 stock_tickets int(10) NOT NULL default '0',
				 max_tickets int(10) NOT NULL default '0',
				 sell_back tinyint(1) NOT NULL default '0',
				 prizes text NOT NULL,
				 correct_numbers text NOT NULL,
				 PRIMARY KEY (l_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_lottery_tickets()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_lottery_tickets (
				 t_id int(9) NOT NULL auto_increment,
				 member_id mediumint(8) NOT NULL default '0',
				 lottery_id int(10) NOT NULL default '0',
				 price_bought bigint(19) NOT NULL default '0',
				 time_bought int(10) NOT NULL default '0',
				 numbers_chosen text NOT NULL,
				 checked tinyint(1) NOT NULL default '0',
				 t_correct varchar(255) NOT NULL default '',
				 extra_settings text NOT NULL default '',
				 ip_address varchar(15) NOT NULL default '',
				 PRIMARY KEY (t_id),
				 KEY lottery (lottery_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_raffle()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_raffle (
				 r_id int(10) NOT NULL auto_increment,
				 r_name varchar(255) NOT NULL default '',
				 r_description text NOT NULL,
				 r_status enum('open','closed','drawn') NOT NULL default 'open',
				 r_prize_sets int(10) NOT NULL default '0',
				 create_time int(10) NOT NULL default '0',
				 start_time int(10) NOT NULL default '0',
				 end_time int(10) NOT NULL default '0',
				 continuous tinyint(1) NOT NULL default '0',
				 r_price bigint(19) NOT NULL default '0',
				 stock_tickets int(10) NOT NULL default '0',
				 max_tickets int(10) NOT NULL default '0',
				 sell_back tinyint(1) NOT NULL default '0',
				 prizes text NOT NULL,
				 PRIMARY KEY  (r_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_raffle_tickets()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_raffle_tickets (
				 t_id int(9) NOT NULL auto_increment,
				 member_id mediumint(8) NOT NULL default '0',
				 raffle_id int(10) NOT NULL default '0',
				 price_bought bigint(19) NOT NULL default '0',
				 time_bought int(10) NOT NULL default '0',
				 checked tinyint(1) NOT NULL default '0',
				 t_prize int(10) NOT NULL default -1,
				 ip_address varchar(15) NOT NULL default '',
				 PRIMARY KEY (t_id),
				 KEY raffle (raffle_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_stock_companies()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_stock_companies (
				 c_id mediumint(8) NOT NULL auto_increment,
				 c_symbol varchar(255) NOT NULL DEFAULT '',
				 c_name varchar(255) NOT NULL DEFAULT '',
				 c_scale float(15,10) NOT NULL DEFAULT '0.0000000000',
				 c_shares bigint(20) NOT NULL DEFAULT '0',
				 PRIMARY KEY  (c_id)
				 ) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_stock_shares()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_stock_shares (
				 share_id int(10) NOT NULL auto_increment,
				 s_symbol_id mediumint(8) NOT NULL DEFAULT '0',
				 s_member_id mediumint(8) NOT NULL DEFAULT '0',
				 s_shares bigint(19) NOT NULL,
				 s_bought_price float(15,10) NOT NULL,
				 s_bought_time int(10) NOT NULL,
				 s_ip_address varchar(15) NOT NULL,
				 PRIMARY KEY (share_id),
				 KEY company (s_symbol_id),
				 KEY member (s_member_id)
				 ) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_paypal_rates()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_paypal_rates (
				 rate_id int(10) NOT NULL auto_increment,
				 real_amount float(10,5) NOT NULL,
				 money_amount bigint(19) NOT NULL,
				 PRIMARY KEY (rate_id)
				 ) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_paypal_logs()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_paypal_logs (
				 l_id int(10) NOT NULL auto_increment,
				 l_member mediumint(8) NOT NULL,
				 l_time int(10) NOT NULL,
				 l_rates_bought TEXT NOT NULL,
				 l_test tinyint(1) NOT NULL,
				 l_paypal_key varchar(255) NOT NULL,
				 l_transaction varchar(16) NOT NULL,
				 l_transaction_id CHAR(19) NOT NULL,
				 l_first_name varchar(64) NOT NULL,
				 l_last_name varchar(64) NOT NULL,
				 l_business_email varchar(127) NOT NULL,
				 l_payer_email varchar(127) NOT NULL,
				 l_payer_id varchar(13) NOT NULL,
				 l_payer_status varchar(10) NOT NULL,
				 l_reciever_email varchar(127) NOT NULL,
				 l_reciever_id varchar(13) NOT NULL,
				 l_real_money float(10,5) NOT NULL,
				 l_real_fee float(10,5) NOT NULL,
				 l_currency char(3) NOT NULL,
				 l_payment_type varchar(7) NOT NULL,
				 l_payment_time varchar(28) NOT NULL,
				 l_payment_status varchar(17) NOT NULL,
				 l_money_got bigint(19) NOT NULL,
				 PRIMARY KEY (l_id),
				 UNIQUE KEY transaction_id (l_transaction_id),
				 KEY member_id (l_member)
				 ) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function raffle_select_random_tickets( $a )
	{
		return "SELECT * FROM ".SQL_PREFIX."market_raffle_tickets WHERE raffle_id=".$a['raffle']." ORDER BY RAND() LIMIT 0,".$a['tickets'];
	}
	
	function table_trade_selling()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_trade_selling (
				 t_id int(10) NOT NULL auto_increment,
				 member_id mediumint(8) NOT NULL,
				 title varchar(255) NOT NULL,
				 description TEXT NOT NULL,
				 time_selling int(10) NOT NULL,
				 trade_exact tinyint(1) NOT NULL,
				 selling_money bigint(20) NOT NULL,
				 want_money bigint(20) NOT NULL,
				 ip_address varchar(15) NOT NULL,
				 PRIMARY KEY (t_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_trade_selling_items()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_trade_selling_items (
				 i_id int(10) NOT NULL auto_increment,
				 t_id int(10) NOT NULL,
				 member_id mediumint(8) NOT NULL default '0',
				 item int(10) NOT NULL default '0',
				 price_bought bigint(19) NOT NULL default '0',
				 resell_price bigint(19) NOT NULL default '0',
				 time_bought int(10) NOT NULL default '0',
				 settings TEXT NOT NULL,
				 expired int(10) NOT NULL default '0',
				 PRIMARY KEY (i_id),
				 KEY trade_id (t_id),
				 KEY item_id (item)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_trade_selling_wants()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_trade_selling_wants (
				 t_id int(10) NOT NULL,
				 item int(10) NOT NULL,
				 quanity int(10) NOT NULL,
				 PRIMARY KEY (t_id,item),
				 KEY trade_id (t_id),
				 KEY item_id (item)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_trade_offers()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_trade_offers (
				 t_id int(10) NOT NULL auto_increment,
				 member_id mediumint(8) NOT NULL,
				 offer_money bigint(20) NOT NULL,
				 offer_time int(10) NOT NULL,
				 ip_address varchar(15) NOT NULL,
				 picked tinyint(1) NOT NULL,
				 PRIMARY KEY (t_id, member_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_trade_offer_items()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_trade_offer_items (
				 t_id int(10) NOT NULL,
				 member_id mediumint(8) NOT NULL default '0',
				 item int(10) NOT NULL default '0',
				 price_bought bigint(19) NOT NULL default '0',
				 resell_price bigint(19) NOT NULL default '0',
				 time_bought int(10) NOT NULL default '0',
				 settings TEXT NOT NULL,
				 expired int(10) NOT NULL default '0',
				 KEY trade (t_id,member_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_trade_logs()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_trade_logs (
				 t_id int(10) NOT NULL,
				 member_id mediumint(8) NOT NULL,
				 title varchar(255) NOT NULL,
				 description TEXT NOT NULL,
				 time_selling int(10) NOT NULL,
				 time_sold int(10) NOT NULL,
				 trade_exact tinyint(1) NOT NULL,
				 selling_money bigint(20) NOT NULL,
				 want_money bigint(20) NOT NULL,
				 ip_address varchar(15) NOT NULL,
				 PRIMARY KEY (t_id)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_trade_log_items()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_trade_log_items (
				 t_id int(10) NOT NULL,
				 member_id mediumint(8) NOT NULL default '0',
				 item int(10) NOT NULL default '0',
				 KEY trade_id (t_id),
				 KEY item_id (item)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
	
	function table_trade_log_wants()
	{
		return "CREATE TABLE ".SQL_PREFIX."market_trade_log_wants (
				 t_id int(10) NOT NULL,
				 item int(10) NOT NULL,
				 quanity int(10) NOT NULL,
				 KEY trade_id (t_id),
				 KEY item_id (item)
				) TYPE=".$this->db->connect_vars['mysql_tbl_type'];
	}
}
	
?>